// 1. 引入jwt-simple
const jwt = require('jwt-simple')

// 2. 生成token
const KEY = '123123'
const token = jwt.encode({ name: 'zs' }, KEY)
console.log(token) // eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoienMifQ.vUSIn3NOEkhXiVn6-Sd7G3x02oLAy6WSM7aOCz16QNs

// 3. 解码token
const result = jwt.decode(token, KEY)
console.log(result)
